package com.firmboy.dubbo_con.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.firmboy.dubbo_api.service.DemoService;
import com.reger.dubbo.annotation.Inject;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author firmboy
 * @create 2018-05-16 下午7:50
 **/
@RequestMapping("/dubbo")
@RestController
public class DemoConsumer{

    @Reference
    DemoService service;


    @RequestMapping("/hello")
    public String hello(){
        int a = 1;
        int b = 2;
        Integer add = service.add(a, b);
        return add.toString();
    }

}
